package com.note.common.enums;

import com.note.common.constants.ResponseCodeConstants;
import com.note.common.constants.ResponseMessageConstants;
import io.swagger.v3.oas.annotations.media.Schema;

;

/**
 * @Package：com.note.user.enums
 * @Name：ResponseEnum
 * @Author：热伊木
 * @Email：uyevan@163.com
 * @Date：2023-12-11-19:09
 * @Description：统一返回枚举类
 */
@Schema(name = "ResponseEnum", description = "用户模块统一返回枚举类")
public enum ResponseEnum implements EnumCode {
    /*默认状态定义*/
    SUCCESS(200, true, "请求成功"),
    FAIL(400, false, "请求有误"),

    /*Sentinel规则enum*/
    TOO_MANY_REQUESTS(429, false, "频繁请求,请稍后再试"),
    CIRCUIT_BREAKER(503, false, "系统访问量过高，请稍后再试"),
    HOT_SPOT(403, false, "恶意访问,请稍后再试"),

    /*用户登录状态定义*/
    LOGIN_SUCCESS(ResponseCodeConstants.LOGIN_SUCCESS, true, ResponseMessageConstants.LOGIN_SUCCESS),
    USER_NOT_FOUND(ResponseCodeConstants.USER_NOT_FOUND, false, ResponseMessageConstants.USER_NOT_FOUND),
    WRONG_PASSWORD(ResponseCodeConstants.WRONG_PASSWORD, false, ResponseMessageConstants.WRONG_PASSWORD),
    USER_BANNED(ResponseCodeConstants.USER_BANNED, false, ResponseMessageConstants.USER_BANNED),
    LOGIN_FAIL(ResponseCodeConstants.LOGIN_FAIL, false, ResponseMessageConstants.LOGIN_FAIL),
    /*用户注册状态定义*/
    REGISTER_SUCCESS(ResponseCodeConstants.REGISTER_SUCCESS, true, ResponseMessageConstants.REGISTRATION_SUCCESS),
    USERNAME_ALREADY_EXISTS(ResponseCodeConstants.USERNAME_ALREADY_EXISTS, false, ResponseMessageConstants.USERNAME_ALREADY_EXISTS),
    REGISTER_FAIL(ResponseCodeConstants.REGISTER_FAIL, false, ResponseMessageConstants.REGISTER_FAIL),

    /*文件夹操作状态*/
    FOLDER_CREATE_FAIL(ResponseCodeConstants.FOLDER_CREATE_FAIL, false, ResponseMessageConstants.FOLDER_CREATE_FAIL),
    FOLDER_EXISTS(ResponseCodeConstants.FOLDER_EXISTS, false, ResponseMessageConstants.FOLDER_EXISTS),
    FOLDER_CREATE_SUCCESS(ResponseCodeConstants.FOLDER_CREATE_SUCCESS, true, ResponseMessageConstants.FOLDER_CREATE_SUCCESS),
    FOLDER_NULL(ResponseCodeConstants.FOLDER_NULL, false, ResponseMessageConstants.FOLDER_NULL),
    DELETE_FOLDER_FAIL(ResponseCodeConstants.DELETE_FOLDER_FAIL, false, ResponseMessageConstants.DELETE_FOLDER_FAIL),
    DELETE_FOLDER_SUCCESS(ResponseCodeConstants.DELETE_FOLDER_SUCCESS, true, ResponseMessageConstants.DELETE_FOLDER_SUCCESS),
    DONT_EXISTS_FOLDER(ResponseCodeConstants.DONT_EXISTS_FOLDER, false, ResponseMessageConstants.DONT_EXISTS_FOLDER),

    /*笔记操作状态*/
    NOTE_REPORT_FAIL(ResponseCodeConstants.NOTE_RECORD_FAIL, false, ResponseMessageConstants.NOTE_RECORD_FAIL),
    NOTE_UPDATE_FAIL(ResponseCodeConstants.NOTE_UPDATE_FAIL, false, ResponseMessageConstants.NOTE_UPDATE_FAIL),
    NOTE_REPORT_SUCCESS(ResponseCodeConstants.NOTE_RECORD_SUCCESS, true, ResponseMessageConstants.NOTE_RECORD_SUCCESS),
    DONT_EXITS_NOTE(ResponseCodeConstants.DONT_EXISTS_NOTE, false, ResponseMessageConstants.DONT_EXISTS_NOTE),
    REMOVE_NOTE_SUCCESS(ResponseCodeConstants.REMOVE_NOTE_SUCCESS, true, ResponseMessageConstants.REMOVE_NOTE_SUCCESS),
    UPDATE_NOTE_SUCCESS(ResponseCodeConstants.UPDATE_NOTE_SUCCESS, true, ResponseMessageConstants.UPDATE_NOTE_SUCCESS),
    NOTE_SEARCH_FAIL(ResponseCodeConstants.NOTE_SEARCH_FAIL, false, ResponseMessageConstants.NOTE_SEARCH_FAIL),
    NOTE_SEARCH_SUCCESS(ResponseCodeConstants.NOTE_SEARCH_SUCCESS, true, ResponseMessageConstants.NOTE_SEARCH_SUCCESS),

    /*分享相关错误状态*/
    SHARE_FIELD(ResponseCodeConstants.SHARE_FAILED, false, ResponseMessageConstants.SHARE_FAILED),
    DELETE_SHARE_FILED(ResponseCodeConstants.DELETE_SHARE_FAILED, false, ResponseMessageConstants.DELETE_SHARE_FAILED),
    CHANGE_SHARE_STATUS_SUCCESS(ResponseCodeConstants.CHANGE_SHARE_STATUS_SUCCESS, true, ResponseMessageConstants.CHANGE_SHARE_STATUS_SUCCESS),
    NO_SHARE_RECORD(ResponseCodeConstants.NO_SHARE_RECORD, false, ResponseMessageConstants.NO_SHARE_RECORD),
    DELETE_SUCCESS(ResponseCodeConstants.DELETE_SUCCESS, true, ResponseMessageConstants.DELETE_SUCCESS),
    SHARE_SUCCESS(ResponseCodeConstants.SHARE_SUCCESS, true, ResponseMessageConstants.SHARE_SUCCESS);


    /*状态码（*）*/
    @Schema(description = "状态码")
    private final int code;
    /*请求状态（*）*/
    @Schema(description = "请求状态")
    private final Boolean status;
    /*状态描述（*）*/
    @Schema(description = "状态描述")
    private final String message;

    private ResponseEnum(int code, boolean status, String message) {
        this.code = code;
        this.status = status;
        this.message = message;
    }


    public int getCode() {
        return code;
    }


    public Boolean getStatus() {
        return status;
    }


    public String getMessage() {
        return message;
    }
}
